package com.techsoul.module.tms.pojo.vo;

import java.math.BigDecimal;
import java.util.Date;

import com.techsoul.common.core.util.lang.DateUtils;
import com.techsoul.common.core.util.lang.StringUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * FreightVehicleDistributionVo
 *
 * @author zhaowei
 * @since 2021-08-24
 */
@Data
@Accessors(chain = true)
public class FreightVehicleDistributionVo {
    /**
     * 记录 ID，系统自动产生
     */
    private String id;
    private String vinNo;

    private String vehicleFueType;
    private String chassisCertNumber;

    private String engineModel;
    @ApiModelProperty("提货仓库编码")
    private String pickUpWarehouseNo;
    @ApiModelProperty("卸货仓库编码")
    private String dropOffWarehouseNo;
    private String engineNo;
    private String orderSource;
    private String vehicleLoadType;
    private String certificatesNo;

    private String manufactory;

    private String vehicleBrand;

    private String vehicleName;

    private String vehicleModel;

    private Date certificatesDate;
    /**
     * 运单号
     */
    private String waybillNo;

    /**
     * 派单编号
     */
    private String assignedId;

    /**
     * 物流计划编号
     */
    private String purchaseOrderId;

    /**
     * 司机姓名
     */
    private String driverName;

    /**
     * 司机手机号
     */
    private String driverMobile;

    /**
     * 是否抢单
     */
    private Boolean bidden;

    /**
     * 是否是自有司机
     */
    private Boolean selfDriver;

    /**
     * 运输车牌号
     */
    private String truckNo;

    /**
     * 货物名称
     */
    private String materialName;

    /**
     * 初期预估重量
     */
    private BigDecimal expectQuantity;

    /**
     * 提货毛重
     */
    private BigDecimal pickupGrossQuantity;

    /**
     * 提货重量
     */
    private BigDecimal pickupQuantity;

    /**
     * 交货毛重
     */
    private BigDecimal deliveryGrossQuantity;

    /**
     * 交货重量
     */
    private BigDecimal deliveryQuantity;

    /**
     * 司机交货重量
     */
    private BigDecimal driverUnloadQuantity;

    /**
     * 提货与交货磅差
     */
    private BigDecimal differQuantity;

    /**
     * 体积
     */
    private BigDecimal volume;

    /**
     * 实际提货时间
     */
    private Date actualPickupTime;

    /**
     * 要求提货时间
     */
    private Date requirePickupTime;

    /**
     * 实际交货时间
     */
    private Date actualDeliveryTime;

    /**
     * 司机交货时间
     */
    private Date driverDeliveryTime;

    /**
     * 要求交货时间
     */
    private Date requireDeliveryTime;

    /**
     * 司机到达矿山图片地址
     */
    private String arriveMineImageUrl;

    /**
     * 取货过磅单单号
     */
    private String pickupWeighNo;

    /**
     * 取货过磅单图片地址
     */
    private String pickupWeighDocumentUrl;

    /**
     * 交货过磅单单号
     */
    private String deliveryWeighNo;

    /**
     * 交货过磅单图片地址
     */
    private String deliveryWeighDocumentUrl;

    /**
     * 运单里程
     */
    private BigDecimal miles;

    /**
     * 是否按时交货
     */
    private Boolean punctualDelivery;

    /**
     * 重量单位
     */
    private String weightMeasUnit;

    /**
     * 体积单位
     */
    private String volumeMeasUnit;

    /**
     * 提货地址
     */
    private String pickupAddress;

    /**
     * 交货地址
     */
    private String deliveryAddress;

    /**
     * 运单运输状态
     */
    private String status;

    /**
     * 交易端结算单对账单号
     */
    private String tradeAccountStatementNo;

    /**
     * 交易端结算单对账状态
     */
    private String tradeAccountCheckStatus;

    /**
     * 交易端物流单对账单号
     */
    private String tradeTransportStatementNo;

    /**
     * 交易端物流单对账状态
     */
    private String tradeTransportCheckStatus;

    /**
     * 备注
     */
    private String remark;

    /**
     * 是否有效，数据字典 yn_type，1 表示是，0 表示否，默认0
     */
    private String isValid;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 创建时间
     */
    private Date createDate;

    /**
     * 更新人
     */
    private String updateBy;

    /**
     * 更新时间
     */
    private Date updateDate;
    private String loadUnitNoDsp;
    private String measUnitNoDsp;
    private String volumeMeasUnitDsp;
    private String weightMeasUnitDsp;
    private String deliveryAddr;
    private String distributorSite;


    private BigDecimal distributionNo;
    /**
     * ref t_fo_freight_vehicle_dispatch
     */
    private String dispatchId;
    private String site;
    private String dispatchNo;
    private String freightOrderNo;
    private String freightOrderLineNo;
    private String vehicleNo;
    private String cargoFreightNo;
    private String cargoFreightName;
    private String cargoFreightType;
    private BigDecimal quantity;
    private String loadUnitNo;
    private String orderSeqId;
    private BigDecimal weight;
    private BigDecimal feeSum;
    private Date backOrderDate;
    private BigDecimal paymentAmount;
    private BigDecimal paymentUnit;
    private BigDecimal deliverQuantity;
    private Date deliverTime;
    private BigDecimal breakQuantity;
    private String measUnitNo;
    private String causeNo;
    private String backOrderDesc;
    private String serviceRemark;
    private String delayDays;
    private String isTransfered;
    private String qtyModifyOrderLineYn;
    private BigDecimal leg;
    private BigDecimal accountPayable;
    private BigDecimal version;
    private String autoDispatchFlag;
    private String deptOrderNo;
    private String driver;
    private String carrierName;
    private String vehicleId;
    private String destination;
    private String consigneeName;
    private String custName;
    private String departmentNo;
    private Date startOffTime;
    private String isFinalDestination;
    private String transitFrSite;
    private String dispatchPlanNo;
    private Date executeDate;
    private String procDepartDesc;
    private String recDepartDesc;
    private String consigeeContactType;
    private String consigeeContactNo;
    private String carrierSite;
    private String isPunctualBack;
    private String isPunctualDelivery;
    private BigDecimal palletQty;
    private BigDecimal accountReceivable;
    private String dispatcher;
    private Date backOrderEstDate;
    private BigDecimal amountExpenseUnitPrice;
    private String chargeAdjustType;
    private String routeDistanceType;
    private String arAddedYn;
    private String serviceUpdateUserId;
    private String podId;
    private String settleBasedOn;
    private Date serviceUpdateDate;
    private String carrierSettleBasedOn;
    private String distributorDeptSite;
    private String warehouseInboundReciptNo;
    private BigDecimal packQty;
    private String shipByPackOrqty;
    private String custSettledBasedon;
    private String cargoFreightSpec;
    private BigDecimal apOtherCharges;
    private String indemnifyYn;
    private String ticketNo;

    private String processedYn;
    private String originCustNo;
    private String shipperName;
    private String processedRtYn;
    private String processedRtUser;
    private Date processedRtTm;
    private String podYn;
    private BigDecimal transitExpense;
    private BigDecimal carrierConfirmedTransitExpense;
    private String processedRtRemark;
    private String isFirstdispatchYn;
    private String shipmentLocation;
    private String carrierNo;
    private BigDecimal amountTransferUnitPrice;
    private BigDecimal amountTransferPrice;
    private String transferSettlebasedOn;
    private BigDecimal orderUnitPrice;
    private Date estDeliveryDate;
    private String podRemark;
    private String textMsgYn;
    private String departExcptImg;
    private String podExcptImg;
    private String containerSealNo;
    private String containerType;
    private String containerNo;
    private String updateFlag;
    private String dengji;
    private String chorderNo;

    private String sourceOrderlineId;
    private String shipmentLocationTreeNames;

    /**
     * 目的地节点全名称
     */
    private String destinationTreeNames;




    public BigDecimal getCustShippedQty() {
        if (!StringUtils.isNull(this.getShipByPackOrqty())) {
            if (this.getShipByPackOrqty().equals("weight")) {
                return this.weight;
            } else if (this.getShipByPackOrqty().equals("volume")) {
                return this.getVolume();
            } else {
                if (this.getShipByPackOrqty().equals("pack")) {
                    return this.getPackQty();
                } else {
                    return this.getQuantity();
                }
            }
        } else {
            if (this.weight != null && this.getWeight().doubleValue() != 0.0) {
                return this.getWeight();
            } else {
                return this.getQuantity();
            }
        }

    }


    public String getVolumeMeasUnitDsp() {
        if (StringUtils.isNotBlank(volumeMeasUnit)) {
            if (("m3").equals(this.volumeMeasUnit)) {
                return "立方米";
            } else if ("ga".equals(this.volumeMeasUnit)) {
                return "加伦";
            } else {
                return "升";
            }
        } else {
            return " ";
        }
    }

    public String getLoadUnitNoDsp() {
        if (StringUtils.isNotBlank(loadUnitNo)) {
            if (this.loadUnitNo.equals("pack")) {
                return "包/袋";
            } else if (this.loadUnitNo.equals("bulk")) {
                return "散装";
            } else if (this.loadUnitNo.equals("bo")) {
                return "件/瓶";
            } else if (this.loadUnitNo.equals("qty")) {
                return "个";
            } else if (this.loadUnitNo.equals("ge")) {
                return "根";
            } else if (this.loadUnitNo.equals("jian")) {
                return "件";
            } else if (this.loadUnitNo.equals("zhi")) {
                return "件/支";
            } else if (this.loadUnitNo.equals("ro")) {
                return "卷";
            } else if (this.loadUnitNo.equals("set")) {
                return "组/套";
            } else if (this.loadUnitNo.equals("box")) {
                return "箱";
            } else if (this.loadUnitNo.equals("po")) {
                return "磅";
            } else if (this.loadUnitNo.equals("piece")) {
                return "张";
            } else if (this.loadUnitNo.equals("none")) {
                return "无包装";
            } else {
                return this.loadUnitNo;
            }
        } else {
            return " ";
        }
    }

    public String getMeasUnitNoDsp() {
        if (StringUtils.isNotBlank(measUnitNo)) {
            if (this.measUnitNo.equals("pack")) {
                return "包/袋";
            } else if (this.measUnitNo.equals("bulk")) {
                return "散装";
            } else if (this.measUnitNo.equals("bo")) {
                return "件/瓶";
            } else if (this.measUnitNo.equals("qty")) {
                return "个";
            } else if (this.measUnitNo.equals("ge")) {
                return "根";
            } else if (this.measUnitNo.equals("jian")) {
                return "件";
            } else if (this.measUnitNo.equals("zhi")) {
                return "件/支";
            } else if (this.measUnitNo.equals("ro")) {
                return "卷";
            } else if (this.measUnitNo.equals("set")) {
                return "组/套";
            } else if (this.measUnitNo.equals("box")) {
                return "箱";
            } else if (this.measUnitNo.equals("po")) {
                return "磅";
            } else if (this.measUnitNo.equals("piece")) {
                return "张";
            } else if (this.measUnitNo.equals("none")) {
                return "无包装";
            } else
                return this.measUnitNo;
        } else {
            return " ";
        }
    }

    public String getWeightMeasUnitDsp() {
        if (StringUtils.isNotBlank(weightMeasUnit)) {
            if (this.weightMeasUnit.equals("t")) {
                return "吨";
            } else if (this.weightMeasUnit.equals("kg")) {
                return "千克";
            } else if (this.weightMeasUnit.equals("lb")) {
                return "磅";
            } else
                return "克";
        } else {
            return " ";
        }
    }

    public void setWeightMeasUnitDsp(String weightMeasUnit) {
        this.weightMeasUnitDsp = weightMeasUnit;
    }


    public void setMeasUnitNoDsp(String measUnitNoDsp) {
        this.measUnitNoDsp = measUnitNoDsp;
    }

    public void setLoadUnitNoDsp(String loadUnitNoDsp) {
        this.loadUnitNoDsp = loadUnitNoDsp;
    }

    public void setVolumeMeasUnitDsp(String volumeMeasUnitDsp) {
        this.volumeMeasUnitDsp = volumeMeasUnitDsp;
    }

}
